home *** CD-ROM | disk | FTP | other *** search
/ By Popular Request 2.0 / By Popular Request 2.0 (Arsenal Computer).ISO / amiga_1 / atcpsd40.lha / AmiTCP-4.0-gcc / netinclude / net / if_dl.h < prev    next >
C/C++ Source or Header  |  1995-04-07  |  2KB  |  60 lines

  1. #ifndef NET_IF_DL_H
  2. #define NET_IF_DL_H \
  3.        "$Id: if_dl.h,v 4.1 1994/10/05 23:16:26 ppessi Exp $"
  4. /*
  5.  *      The Link-Level Socket Interface 
  6.  *
  7.  *      Copyright ⌐ 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /* 
  13.  * A Link-Level Sockaddr may specify the interface in one of two
  14.  * ways: either by means of a system-provided index number (computed
  15.  * anew and possibly differently on every reboot), or by a human-readable
  16.  * string such as "il0" (for managerial convenience).
  17.  * 
  18.  * Census taking actions, such as something akin to SIOCGCONF would return
  19.  * both the index and the human name.
  20.  * 
  21.  * High volume transactions (such as giving a link-level ``from'' address
  22.  * in a recvfrom or recvmsg call) may be likely only to provide the indexed
  23.  * form, (which requires fewer copy operations and less space).
  24.  * 
  25.  * The form and interpretation  of the link-level address is purely a matter
  26.  * of convention between the device driver and its consumers; however, it is
  27.  * expected that all drivers for an interface of a given if_type will agree.
  28.  */
  29.  
  30. /*
  31.  * Structure of a Link-Level sockaddr:
  32.  */
  33. struct sockaddr_dl {
  34.     u_char    sdl_len;    /* Total length of sockaddr */
  35.     u_char    sdl_family;    /* AF_DLI */
  36.     u_short    sdl_index;    /* if != 0, system given index for interface */
  37.     u_long    sdl_type;    /* interface type */
  38.     u_char    sdl_nlen;    /* interface name length, no trailing 0 reqd. */
  39.     u_char    sdl_alen;    /* link level address length */
  40.     u_char    sdl_slen;    /* link layer selector length */
  41.     char    sdl_data[IFNAMSIZ + 12];    
  42.                 /* minimum work area, can be larger;
  43.                    contains both if name and ll address */
  44. };
  45.  
  46. #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
  47.  
  48. #ifndef KERNEL
  49.  
  50. #include <sys/cdefs.h>
  51.  
  52. __BEGIN_DECLS
  53. void    link_addr __P((const char *, struct sockaddr_dl *));
  54. char    *link_ntoa __P((const struct sockaddr_dl *));
  55. __END_DECLS
  56.  
  57. #endif /* !KERNEL */
  58.  
  59. #endif /* NET_IF_DL_H */
  60.